package ltd.dujiabao.mavenLocalInstaller.domain;

import ltd.dujiabao.mavenLocalInstaller.util.StringUtils;

/**
 * @author : DuJiabao
 * @Project : mavenLocalInstaller
 * @Time : 2021/9/28 23:32
 * @Desc :
 */
public class PomPropertiesBuilder {
    private String groupId;
    private String artifactId;
    private String version;

    public PomProperties build() {
        if (StringUtils.isEmpty(groupId) || StringUtils.isEmpty(artifactId) || StringUtils.isEmpty(version)) {
            return null;
        }
        return new PomProperties(groupId, artifactId, version);
    }

    public String getGroupId() {
        return groupId;
    }

    public PomPropertiesBuilder setGroupId(String groupId) {
        this.groupId = groupId;
        return this;
    }

    public String getArtifactId() {
        return artifactId;
    }

    public PomPropertiesBuilder setArtifactId(String artifactId) {
        this.artifactId = artifactId;
        return this;
    }

    public String getVersion() {
        return version;
    }

    public PomPropertiesBuilder setVersion(String version) {
        this.version = version;
        return this;
    }
}
